package org.third.common.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.third.common.domain.entity.ReconfigurationUrlType;

@Entity
@Table(name = "suite_reconfiguration")
public class SuiteReconfiguration {

	@Id  
    @GeneratedValue(generator="MyGenerator")
    @GenericGenerator(name="MyGenerator", strategy="foreign", parameters=@Parameter(value="deployment", name = "property"))  
	@Column(name = "deployment_id")
	private Long deploymentId;

	@Column(name = "reconfiguration_url", nullable = true)
	private String reconfigurationUrl;
	
	@Column(name = "reconfiguration_port", nullable = true)
	private int reconfigurationPort;
	
	@Column(name = "reconfiguration_url_type", nullable = false)
	@Enumerated(EnumType.STRING)
	private ReconfigurationUrlType reconfigurationUrlType;
	
	@Column(name = "stop_suite_config", nullable = false)
	private boolean stopSuiteConfigPod;
	
	@OneToOne(cascade=CascadeType.ALL, fetch = FetchType.LAZY)  
	@JoinColumn(name="deployment_id")
	private Deployment  deployment;

	public Long getDeploymentId() {
		return deploymentId;
	}

	public void setDeploymentId(Long deploymentId) {
		this.deploymentId = deploymentId;
	}

	public String getReconfigurationUrl() {
		return reconfigurationUrl;
	}

	public void setReconfigurationUrl(String reconfigurationUrl) {
		this.reconfigurationUrl = reconfigurationUrl;
	}

	public ReconfigurationUrlType getReconfigurationUrlType() {
		return reconfigurationUrlType;
	}

	public void setReconfigurationUrlType(
			ReconfigurationUrlType reconfigurationUrlType) {
		this.reconfigurationUrlType = reconfigurationUrlType;
	}

	public boolean isStopSuiteConfigPod() {
		return stopSuiteConfigPod;
	}

	public void setStopSuiteConfigPod(boolean stopSuiteConfigPod) {
		this.stopSuiteConfigPod = stopSuiteConfigPod;
	}

	public Deployment getDeployment() {
		return deployment;
	}

	public void setDeployment(Deployment deployment) {
		this.deployment = deployment;
	}

	public int getReconfigurationPort() {
		return reconfigurationPort;
	}

	public void setReconfigurationPort(int reconfigurationPort) {
		this.reconfigurationPort = reconfigurationPort;
	}

}